package sk.gtug.hackatlon.drunkdroid.models;

public class Collisional {
	private int mX;
	private int mY;
	private int mRadius;
	
	public Collisional(int x, int y, int radius){
		mX = x;
		mY = y;
		mRadius = radius;
	}
	public int getX() {
    	return mX;
    }
	public void setX(int mX) {
    	this.mX = mX;
    }
	public int getY() {
    	return mY;
    }
	public void setY(int mY) {
    	this.mY = mY;
    }
	public int getRadius() {
    	return mRadius;
    }
	public void setRadius(int mRadius) {
    	this.mRadius = mRadius;
    }
	
	public boolean isCollision(Collisional obj) {		
		int distance = (int) Math.sqrt( 
								Math.pow(Math.abs(this.getX() - obj.getX()), 2) + 
								Math.pow(Math.abs(this.getY() - obj.getY()), 2));
		
		return (distance < this.getRadius() + obj.getRadius());
    }

	
}
